/**
 * All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
 *
 * MeetManageActionAuto
 * 会议管理
 *
 * 修改纪录
 * 2020-08-14 版本：1.0 wanghongwei 创建。
 * @version 版本：1.0
 * @author 作者：wanghongwei
 * 创建日期：2020-08-14
 */

package com.topscomm.meet.controller.auto;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.topscomm.cbo.model.TreeModel;
import com.topscomm.meet.MeetController;
import com.topscomm.meet.pojo.MeetManageEntity;
import com.topscomm.meet.service.IMeetManageService;
import com.topscomm.meet.service.impl.MeetTypeManageService;
import com.topscomm.pub.vo.ResponseResult;

public class MeetManageControllerAuto extends MeetController<MeetManageEntity, IMeetManageService> {
	@Autowired
	private MeetTypeManageService meetTypeManageService;

	/**
	 *
	 * @description:
	 * @param paraMap
	 * @return
	 * @author: wanghongwei
	 * @date: 2020-08-14
	 * @modify:
	 */
	@Override
	@GetMapping(value = "/dataCodeList")
	public ResponseResult<Object> dataCodeList(@RequestParam(required = false) Map<String, Object> paraMap) {
		Map<String, Object> codeMap = new HashMap<String, Object>();

		// 会议配置
		List<Map<String, Object>> sourceList = datacodeCache.getCodeListMap("MeetBoardRoomConfig", "", "sortcode");
		codeMap.put("sourcelistList", sourceList);
		List<Map<String, Object>> reminderfrequencyList = datacodeCache.getCodeListMap("ReminderType", "", "sortcode");
		codeMap.put("reminderfrequencyList", reminderfrequencyList);
		List<Map<String, Object>> sharetypeList = datacodeCache.getCodeListMap("MeetShare", "", "sortcode");
		codeMap.put("sharetypeList", sharetypeList);
		List<Map<String, Object>> enabledList = datacodeCache.getCodeListMap("CboYesNo", "", "sortcode");
		codeMap.put("enabledList", enabledList);
		List<Map<String, Object>> meetvisibletypeList = datacodeCache.getCodeListMap("MeetVisibleType", "", "sortcode");
		codeMap.put("meetvisibletypeList", meetvisibletypeList);
		List<Map<String, Object>> launchorgtypeList = datacodeCache.getCodeListMap("LaunchOrgType", "", "sortcode");
		codeMap.put("launchorgtypeList", launchorgtypeList);
		List<Map<String, Object>> noticetypeList = datacodeCache.getCodeListMap("BaseNoticeType", "", "sortcode");
		codeMap.put("noticetypeList", noticetypeList);
		List<Map<String, Object>> periodtypeList = datacodeCache.getCodeListMap("WorkPeriodType", "", "sortcode");
		codeMap.put("periodtypeList", periodtypeList);
		List<Map<String, Object>> meetstyleList = datacodeCache.getCodeListMap("MeetStyle", "", "sortcode");
		codeMap.put("meetstyleList", meetstyleList);
		// 会议类型树
		List<Map<String, Object>> listNewModule = this.meetTypeManageService.queryMapByWhere(" 1=1 order by sortcode");
		TreeModel treeModel = new TreeModel();
		codeMap.put("meetTypeList", treeModel.buildTree(listNewModule, false, "会议类型树"));
		super.dataCodeList(paraMap);
		return ResponseResult.ok(codeMap);
	}
}
